﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Objects;
using System.Data.Common;
using System.Linq;
using System.Text;

namespace MvcBase
{
    public class BaseTransaction
    {
        public static DbTransaction BeginTransaction( ObjectContext context)
        {
            if (context.Connection.State != ConnectionState.Open)
            {
                context.Connection.Open();
            }
            return context.Connection.BeginTransaction();
        }
    }
}
